//...  把对象和数组展开

let arr = [1,2,3];

//1.赋值数组

let arr1 = [...arr];

console.log(arr1);

//2.合并数组的方法

let arr2 = ['hello','lili'];

// let total = arr1.concat(arr2);

let total = [...arr1,...arr2]

console.log(total);

let obj1 = {name:'lili',age:10};

let obj2 = {age:18};

console.log({...obj1,...obj2});

//合并对象 会修改第一个对象

let obj = Object.assign({},obj1,obj2);

console.log(obj)

console.log(obj1);

//函数rest参数  剩余的参数组成的数组

function sum(str,...nums){
    console.log(nums)
    // console.log(Array.from(arguments))
}

sum('总和',1,2,3,4,5,6);

//react redux





